<template>
  <div class="brand">
    <h3>品牌制造商直供</h3>
    <ul class="list">
      <li v-for="item in list" :key="item.id" @click="handleClick(item.id)">
        <img v-lazy="item.pic_url" alt="" />
        <span class="name">{{ item.name }}</span>
        <span class="price">{{ $global.toYuan(item.floor_price) }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'brand',
  props: ['list'],
  methods: {
    handleClick (id) {
      this.$emit('gotoBrand', id)
    }
  }
}
</script>

<style lang='less' scoped>
.brand {
  margin: 0.2rem 0;
  background-color: #fff;
  h3 {
    height: 0.5rem;
    line-height: 0.5rem;
    text-align: center;
    font-size: 0.2rem;
  }
  .list {
    padding: 0 0.03rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    li {
      width: 49%;
      position: relative;
      img {
        width: 100%;
      }
      .name {
        position: absolute;
        top: 0.1rem;
        left: 0.1rem;
        font-size: 0.14rem;
      }
      .price {
        position: absolute;
        top: 0.4rem;
        left: 0.1rem;
        color: #8b0000;
      }
    }
  }
}
</style>
